package com.xiaohao.server.chromosome.controller;

import com.xiaohao.server.chromosome.bean.ChromosomeImage;
import com.xiaohao.server.chromosome.bean.ResponseResult;
import com.xiaohao.server.chromosome.service.ChromosomeImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("chromosome")
public class ChromosomeImageController {
    @Autowired
    private ChromosomeImageService chromosomeImageService;

    @GetMapping
    public ResponseResult<List<ChromosomeImage>> queryList(ChromosomeImage chromosomeImag) {
        return ResponseResult.success(chromosomeImageService.queryList(chromosomeImag));
    }


    @GetMapping("{id}")
    public ResponseResult<ChromosomeImage> queryById(@PathVariable Integer id) {
        return ResponseResult.success(chromosomeImageService.queryById(id));
    }


    @PostMapping
    public void save(@RequestBody ChromosomeImage chromosomeImage) {
        chromosomeImageService.save(chromosomeImage);
    }

    @DeleteMapping("{id}")
    public void delete(@PathVariable Integer id) {
        chromosomeImageService.delete(id);
    }


}
